#include "junix.h"
using namespace std;

int main(int argc, char **argv)
{
	vector<int> v(30);
	generate(v.begin(), v.end(),
			boost::bind( modulus<int>(), boost::bind(rand), 40));
	ostream_iterator<int> oit(cout, " ");
	copy(v.begin(),v.end(),oit);
	cout<<endl;

	sort(v.begin(),v.begin()+15);
	sort(v.begin()+15, v.end());
	copy(v.begin(),v.end(),oit);
	cout<<endl;

	inplace_merge(v.begin(), v.begin()+15,  v.end());
	copy(v.begin(), v.end(), oit);
	cout<<endl;
}
